<%@page import="com.xnx3.j2ee.Global"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<jsp:include page="/wm/common/head.jsp">
	<jsp:param name="title" value="编辑" />
</jsp:include>
<style>
.layui-laydate-content>.layui-laydate-list {
	padding-bottom: 0px;
	overflow: hidden;
}

.layui-laydate-content>.layui-laydate-list>li {
	width: 50%
}

.merge-box .scrollbox .merge-list {
	padding-bottom: 5px;
}

.layui-laydate-content>.layui-laydate-list>li:nth-child(2)>ol>li:nth-child(-n+30):nth-child(n+2)
	{
	display: none;
}

.layui-laydate-content>.layui-laydate-list>li:nth-child(2)>ol>li:nth-child(-n+60):nth-child(n+32)
	{
	display: none;
}
</style>

<form
	style="padding-top: 35px; margin-bottom: 10px; padding-right: 35px;">
	<input type="hidden" name="id" value="${entity.id }" />

	<div class="layui-form-item">
		<label class="layui-form-label">开始时间</label>
		<div class="layui-input-block">
			<jsp:include page="/wm/common/edit/form_date.jsp">
				<jsp:param name="wm_name" value="startTime" />
				<jsp:param name="wm_value" value="${entity.startTime }" />
				<jsp:param name="wm_type" value="time" />
			</jsp:include>
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">结束时间</label>
		<div class="layui-input-block">
			<jsp:include page="/wm/common/edit/form_date.jsp">
				<jsp:param name="wm_name" value="endTime" />
				<jsp:param name="wm_value" value="${entity.endTime }" />
				<jsp:param name="wm_type" value="time" />
			</jsp:include>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">休息日期</label>
		<div class="layui-input-block">
			<select id="organId" name="restTime" multiple="multiple">
				<option value="无">无</option>
				<option value="星期一">星期一</option>
				<option value="星期二">星期二</option>
				<option value="星期三">星期三</option>
				<option value="星期四">星期四</option>
				<option value="星期五">星期五</option>
				<option value="星期六">星期六</option>
				<option value="星期日">星期日</option>
			</select>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">假期开始时间</label>
		<div class="layui-input-block">
			<jsp:include page="/wm/common/edit/form_date.jsp">
				<jsp:param name="wm_name" value="newYearStartRestTime" />
				<jsp:param name="wm_value" value="${entity.newYearStartRestTime }" />
				<jsp:param name="wm_type" value="date" />
			</jsp:include>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">假期结束时间</label>
		<div class="layui-input-block">
			<jsp:include page="/wm/common/edit/form_date.jsp">
				<jsp:param name="wm_name" value="newYearEndRestTime" />
				<jsp:param name="wm_value" value="${entity.newYearEndRestTime }" />
				<jsp:param name="wm_type" value="date" />
			</jsp:include>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">假期提示语</label>
		<div class="layui-input-block">
			<textarea name="newYearTip" placeholder="请输入假期提示语"
				class="layui-textarea">${entity.newYearTip }</textarea>
		</div>
	</div>

	<div class="layui-form-item" style="padding-top: 15px;">
		<div class="layui-input-block">
			<button class="layui-btn" lay-submit="" lay-filter="demo1">保存</button>
		</div>
	</div>
</form>
<!-- Latest compiled and minified CSS -->
<link type="text/css" rel="styleSheet" href="/css/select.css" />

<!-- Latest compiled and minified JavaScript -->
<script src="/js/select.js" type="text/javascript"></script>
<script>
//自适应弹出层大小
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
//parent.layer.iframeAuto(index);

layui.use(['form', 'layedit', 'laydate'], function(){
	var form = layui.form;

	//监听提交
	form.on('submit(demo1)', function(data){
		parent.parent.msg.loading("保存中");
		var postDate = wm.getJsonObjectByForm($("form"));	//提交的表单数据
		wm.post('save.json', postDate, function (obj) { 
			parent.parent.msg.close();
			if(obj.result == '1'){
				parent.parent.msg.success("操作成功")
				parent.layer.close(index);
				parent.location.reload();	//刷新父窗口
			}else if(obj.result == '0'){
				parent.parent.msg.failure(obj.info);
			}else{
				parent.parent.msg.failure(result);
			}
		});
	    
		return false;
	});
});

$(function () {
	
  $("#organId").fSelect();
});  

</script>

<jsp:include page="/wm/common/foot.jsp"></jsp:include>
